using System.Collections.Generic;
using System.Runtime.CompilerServices;
using Triton.Game.Abstraction;
using Triton.Game.Mapping;

namespace Triton.Game.Data
{
	public class ArenaDraftData
	{
		[CompilerGenerated]
		private Triton.Game.Abstraction.Actor actor_0;

		[CompilerGenerated]
		private List<Triton.Game.Abstraction.Actor> list_0;

		[CompilerGenerated]
		private Triton.Game.Abstraction.Actor actor_1;

		[CompilerGenerated]
		private List<Triton.Game.Abstraction.EntityDef> list_1;

		[CompilerGenerated]
		private int int_0;

		[CompilerGenerated]
		private int int_1;

		public Triton.Game.Abstraction.Actor Hero
		{
			[CompilerGenerated]
			get
			{
				return actor_0;
			}
			[CompilerGenerated]
			private set
			{
				actor_0 = value;
			}
		}

		public List<Triton.Game.Abstraction.Actor> Choices
		{
			[CompilerGenerated]
			get
			{
				return list_0;
			}
			[CompilerGenerated]
			private set
			{
				list_0 = value;
			}
		}

		public Triton.Game.Abstraction.Actor Selection
		{
			[CompilerGenerated]
			get
			{
				return actor_1;
			}
			[CompilerGenerated]
			set
			{
				actor_1 = value;
			}
		}

		public List<Triton.Game.Abstraction.EntityDef> Deck
		{
			[CompilerGenerated]
			get
			{
				return list_1;
			}
			[CompilerGenerated]
			private set
			{
				list_1 = value;
			}
		}

		public int Wins
		{
			[CompilerGenerated]
			get
			{
				return int_0;
			}
			[CompilerGenerated]
			private set
			{
				int_0 = value;
			}
		}

		public int Losses
		{
			[CompilerGenerated]
			get
			{
				return int_1;
			}
			[CompilerGenerated]
			private set
			{
				int_1 = value;
			}
		}

		public void RandomSelection()
		{
			Selection = Choices[Client.Random.Next(0, Choices.Count)];
		}

		public ArenaDraftData()
		{
			Deck = new List<Triton.Game.Abstraction.EntityDef>();
			DraftDisplay draftDisplay = DraftDisplay.Get();
			if (draftDisplay.m_chosenHero != null)
			{
				Hero = new Triton.Game.Abstraction.Actor(draftDisplay.m_chosenHero);
			}
			Choices = new List<Triton.Game.Abstraction.Actor>();
			foreach (DraftDisplay.DraftChoice choice in draftDisplay.m_choices)
			{
				Choices.Add(new Triton.Game.Abstraction.Actor(choice.m_actor));
			}
			DefLoader defLoader = DefLoader.Get();
			DraftManager draftManager = DraftManager.Get();
			foreach (CollectionDeckSlot slot in draftManager.m_draftDeck.m_slots)
			{
				for (int i = 0; i < slot.Count; i++)
				{
					Deck.Add(new Triton.Game.Abstraction.EntityDef(defLoader.GetEntityDef(slot.CardID)));
				}
			}
			Wins = draftManager.m_wins;
			Losses = draftManager.m_losses;
		}
	}
}
